package com.zzl.study.sharding.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzl.study.sharding.domain.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: zhangzl
 * @date: 2022/7/24 14:23
 * @version: 1.0
 * @description: 学生Mapper
 */
@Repository
public interface StudentMapper extends BaseMapper<Student> {

    /**
     * 插入学生表
     *
     * @param student 学生对象
     */
    @Insert("insert into t_student(id, name, grade) value(#{id}, #{name}, #{grade}) /*shadow:true,foo:bar*/")
    void insertHint(Student student);

    /**
     * 查询学生表
     *
     * @return 学生集合
     */
    @Select("select * from t_student /*shadow:true,foo:bar*/")
    List<Student> selectListHint();

}
